<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/7
  Time: 17:07
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="../../../base.jsp" %>
<div class="modal-header">
    <h3 class="text-left text-primary">
        ${paperCard.name }
        <c:if test="${paperCard.status == 0}">
            <i style="color: black">[未发布]</i>
        </c:if>
        <c:if test="${paperCard.status == 50}">
            <i style="color: green">[已发布]</i>
        </c:if>
        <c:if test="${paperCard.status == 99}">
            <i style="color: red">[已废除]</i>
        </c:if>
        <button type="button" class="btn btn-primary"
                onclick="paperCard.editPage('${paperCard.paperCardId}');">修改
        </button>
    </h3>
    <form class="form-horizontal showFrom text-left">
        <div class="form-group">
            <label class="col-sm-1 control-label">卡片描述:</label>
            <div class="col-sm-8">
                <p class="form-control-static">${paperCard.descr}</p>
            </div>
        </div>
    </form>
</div>

<br>
<div class="">
    <%--显示卡片的表单--%>
    <form class="form-horizontal showFrom text-left">
        <input value="${paperCard.paperCardId}" hidden name="paperCard.paperCardId">

        <div class="form-group">
            <label class="col-sm-2 control-label">卡片正面图片</label>
            <div class="col-sm-8 text-left">
                <button type="button" class="btn btn-primary btn-sm"
                        onclick="paperCard.uploadCardImg('${frontFile.fileId}','${paperCard.paperCardId}',ModuleCode.CARD_FRONT)">
                    添加/替换
                </button>
                <br>
                <c:if test="${frontFile != null}">
                    <img src="${fileBaseUrl}/sysfile/download?sysFile.fileId=${frontFile.fileId}"
                         alt=" 加载失败" class="img-thumbnail" id="pic_front">
                </c:if>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">卡片正面小图片</label>
            <div class="col-sm-8 text-left">
                <button type="button" class="btn btn-primary btn-sm"
                        onclick="paperCard.uploadCardImg('${frontFileTH.fileId}','${paperCard.paperCardId}',ModuleCode.CARD_FRONT_TH)">
                    添加/替换
                </button>
                <br>
                <c:if test="${frontFileTH != null}">
                    <img src="${fileBaseUrl}/sysfile/download?sysFile.fileId=${frontFileTH.fileId}"
                         alt=" 加载失败" class="img-thumbnail" id="pic_front">
                </c:if>

            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">卡片背面图片</label>
            <div class="col-sm-8 text-left">
                <button type="button" class="btn btn-primary btn-sm"
                        onclick="paperCard.uploadCardImg('${backFile.fileId}','${paperCard.paperCardId}',ModuleCode.CARD_BACK)">
                    添加/替换
                </button>
                <br>
                <c:if test="${backFile != null}">
                    <img src="${fileBaseUrl}/sysfile/download?sysFile.fileId=${backFile.fileId}"
                         alt=" 加载失败" class="img-thumbnail">
                </c:if>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-2 control-label">卡片背面小图片</label>
            <div class="col-sm-8 text-left">
                <button type="button" class="btn btn-primary btn-sm"
                        onclick="paperCard.uploadCardImg('${backFileTH.fileId}','${paperCard.paperCardId}',ModuleCode.CARD_BACK_TH)">
                    添加/替换
                </button>
                <br>
                <c:if test="${backFileTH != null}">
                    <img src="${fileBaseUrl}/sysfile/download?sysFile.fileId=${backFileTH.fileId}"
                         alt=" 加载失败" class="img-thumbnail">
                </c:if>
            </div>
        </div>

    </form>

</div>
<script src="${basePath}js/paperCard/paperCard.js"></script>